# -*- coding:utf-8 -*-
#! python3

from facecat import *

gPaint = FCPaint() #创建绘图对象
gPaint.defaultUIStyle = "dark"

#消息循环
def WndProc(hwnd,msg,wParam,lParam):
	return WndProcDefault(gPaint,hwnd,msg,wParam,lParam)

#创建窗体
createMainWindow(gPaint, "facecat-py", WndProc)

#创建日历
calendar = FCCalendar()
#添加到主框架
addView(calendar, gPaint)
calendar.borderColor = "none"
calendar.textColor = "none"
calendar.dock = "fill"
#初始化日历
initCalendar(calendar)
#设置默认日期
calendar.selectedDay = getYear(calendar.years, 2022).months[10].days[1]
updateCalendar(calendar)
if calendar.paint.defaultUIStyle == "dark":
	calendar.backColor = "rgb(0,0,0)"
	calendar.headDiv.backColor = "rgb(0,0,0)"
	calendar.headDiv.textColor = "rgb(255,255,255)"
	#初始化日的按钮
	dayButtonsSize = len(calendar.dayDiv.dayButtons)
	for i in range(0,dayButtonsSize):
		dayButton = calendar.dayDiv.dayButtons[i]
		dayButton_am = calendar.dayDiv.dayButtons[i]
		dayButton.textColor2 = "rgb(200,200,200)"
		dayButton.textColor = "rgb(255,255,255)"
		dayButton.borderColor = "rgb(100,100,100)"
		dayButton_am.textColor2 = "rgb(200,200,200)"
		dayButton_am.textColor = "rgb(255,255,255)"
		dayButton_am.borderColor = "rgb(100,100,100)"
	#初始化月的按钮
	monthButtonsSize = len(calendar.monthDiv.monthButtons)
	for i in range(0,monthButtonsSize):
		monthButton = calendar.monthDiv.monthButtons[i]
		monthButton_am = calendar.monthDiv.monthButtons[i]
		monthButton.textColor = "rgb(255,255,255)"
		monthButton.borderColor = "rgb(100,100,100)"
		monthButton_am.textColor = "rgb(255,255,255)"
		monthButton_am.borderColor = "rgb(100,100,100)"
	#初始化年的按钮
	yearButtonsSize = len(calendar.yearDiv.yearButtons)
	for i in range(0,yearButtonsSize):
		yearButton = calendar.yearDiv.yearButtons[i]
		yearButton_am = calendar.yearDiv.yearButtons[i]
		yearButton.textColor = "rgb(255,255,255)"
		yearButton.borderColor = "rgb(100,100,100)"
		yearButton.textColor = "rgb(255,255,255)"
		yearButton.borderColor = "rgb(100,100,100)"
elif calendar.paint.defaultUIStyle == "light":
	calendar.backColor = "rgb(255,255,255)"
	calendar.headDiv.backColor = "rgb(255,255,255)"
	calendar.headDiv.textColor = "rgb(0,0,0)"
	#初始化日的按钮
	dayButtonsSize = len(calendar.dayDiv.dayButtons)
	for i in range(0,dayButtonsSize):
		dayButton = calendar.dayDiv.dayButtons[i]
		dayButton_am = calendar.dayDiv.dayButtons[i]
		dayButton.textColor2 = "rgb(50,50,50)"
		dayButton.textColor = "rgb(0,0,0)"
		dayButton.borderColor = "rgb(150,150,150)"
		dayButton_am.textColor2 = "rgb(50,50,50)"
		dayButton_am.textColor = "rgb(0,0,0)"
		dayButton_am.borderColor = "rgb(150,150,150)"
	#初始化月的按钮
	monthButtonsSize = len(calendar.monthDiv.monthButtons)
	for i in range(0,monthButtonsSize):
		monthButton = calendar.monthDiv.monthButtons[i]
		monthButton_am = calendar.monthDiv.monthButtons[i]
		monthButton.textColor = "rgb(0,0,0)"
		monthButton.borderColor = "rgb(150,150,150)"
		monthButton_am.textColor = "rgb(0,0,0)"
		monthButton_am.borderColor = "rgb(150,150,150)"
	#初始化年的按钮
	yearButtonsSize = len(calendar.yearDiv.yearButtons)
	for i in range(0,yearButtonsSize):
		yearButton = calendar.yearDiv.yearButtons[i]
		yearButton_am = calendar.yearDiv.yearButtons[i]
		yearButton.textColor = "rgb(0,0,0)"
		yearButton.borderColor = "rgb(150,150,150)"
		yearButton_am.textColor = "rgb(0,0,0)"
		yearButton_am.borderColor = "rgb(150,150,150)"
updateViewDefault(gPaint.views)
showWindow(gPaint)